<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">


<ui:composition template="/WEB-INF/templates/BasicTemplate.xhtml">
	<ui:define name="content">
		<h:form>
			<h:panelGrid columns="2">
				<h:outputText value="Name" />
				<h:inputText value="#{person.name}" />
				<h:outputText value="Surname" />
				<h:inputText value="#{person.surname}" />
				<h:outputText value="Meslek" />
				<h:inputText id="inputJob" value="#{autoComplete.curr}" />
				<h:inputText id="inputJob2" value="#{autoComplete.curr2}" />
				<h:commandButton>
					<f:ajax execute="inputJob inputJob2" render="outputJob" />
				</h:commandButton>
				<h:selectOneListbox id="outputJob" value="#{person.job}">
					<f:selectItems value="#{autoComplete.hashJob()}" var="c"
						itemValue="#{c}" />
				</h:selectOneListbox>
			</h:panelGrid>

			<h:commandButton value="Ekle" actionListener="#{personList.add}">
				<f:attribute name="name" value="#{person.name}" />
				<f:attribute name="surname" value="#{person.surname}" />
				<f:attribute name="job" value="#{person.job}" />
			</h:commandButton>

			<p:dataTable var="item" value="#{personList.list}">
				<p:column headerText="Name">
					<h:outputText value="#{item.name}" />
				</p:column>

				<p:column headerText="Surname">
					<h:outputText value="#{item.surname}" />
				</p:column>
				
				<p:column headerText="Job">
					<h:outputText value="#{item.job}" />
				</p:column>

			</p:dataTable>

		
			<h:commandButton value="Tabloya Aktar" action="aktar"
				actionListener="#{permanentPerson.listCopy}">
				<f:attribute name="list" value="#{personList.list}" />
			</h:commandButton>
		</h:form>
	</ui:define>
</ui:composition>
</html>